<template>
  <div id="app">
    <el-container>
      <el-header>
        <span id="logo" class="way">
          <img src="../../assets/images/logo-1.png" alt="" />
        </span>
        <el-menu :default-active="this.activePath" mode="horizontal" style="height" router>
          <el-menu-item index="home" @click="saveNavState('home')">首页</el-menu-item>
          <el-menu-item index="new_goods" @click="saveNavState('new_goods')">新品上市</el-menu-item>
          <el-menu-item index="all_goods" @click="saveNavState('all_goods')">全部商品</el-menu-item>
        </el-menu>

        <!-- <div id="header_right">
          <button id="login_register" :style="login_register">
            登录/注册
          </button>
          <el-badge :value="shoppingCartNum" class="item">
            <i class="el-icon-s-goods"></i>
          </el-badge>

          <el-dropdown>
            <span class="uName">
              {{ userName }} <i class="el-icon-arrow-down el-icon--right"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item class="drop">个人信息</el-dropdown-item>
              <el-dropdown-item divided class="drop">
                <el-button id="logout" @click="logout">退出登录</el-button>
              </el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </div> -->
        <div id="header_right">
          <button id="login_register" :style="login_register" @click="to(1)">
            登录/注册
          </button>
          <el-badge :value="shoppingCartNum" class="item">
            <i class="el-icon-s-goods" @click="to(2)"></i>
          </el-badge>

          <el-dropdown>
            <span class="uName" @click="to(3)">
              {{ userName }} <i class="el-icon-arrow-down el-icon--right"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item class="drop" @click.native="to(3)">个人信息</el-dropdown-item>
              <el-dropdown-item divided class="drop">
                <el-button id="logout" @click="logout">退出登录</el-button>
              </el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </div>
      </el-header>

      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </div>
</template>

<script src="../../assets/js/mainView/mainview.js">
</script>

<style src="../../assets/css/mainView/mainview.css">
</style>